﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using HA.Data;

using System.Windows.Controls;

namespace HA.ModFlow.Application
{
    public class ImageViewModel: MDTVIViewModel
    {

        public ImageViewModel(MDTVIViewModel parent, BitImageInfoes imageInfo)
        {

            this._imageInfo = imageInfo;


            this._imageSource = VMImageSource.image;

            this._contextMenu = new System.Windows.Controls.ContextMenu();

            MenuItem mi = new MenuItem();
            mi.Header = "缩放到...";
            mi.Command = GISCommands.ExtentToCurrent;
            mi.CommandParameter = _imageInfo.Id;

            this._contextMenu.Items.Add(mi);

            this._contextMenu.Items.Add(new Separator());


            mi = new MenuItem();
            mi.Header = "Reconfig";

            this._contextMenu.Items.Add(mi);

            //位图
            this._contextMenu.Items.Add(new Separator());
            //mi = new MenuItem();
            //mi.Header = "编辑位图";
            //mi.Command = GISCommands.EditImage;
            //this._contextMenu.Items.Add(mi);

            mi = new MenuItem();
            mi.Header = "删除位图";
            mi.Command = GISCommands.DelImage;
            mi.CommandParameter = _imageInfo;
            this._contextMenu.Items.Add(mi);
        }

        BitImageInfoes _imageInfo;

        public BitImageInfoes ImageInfo
        {
            get { return _imageInfo; }
        }

        public override string Desc
        {
            get
            {
                return this._imageInfo.Desc;
            }
        }

        protected override void OnSelectedChanged()
        {

            //if (this.IsSelected)
            //{

                
            //}
            
        }

        protected override void OnCheckedChanged()
        {

            GisModule.DefaultModule.SetLayerVisible(this._imageInfo.Id,this.IsChecked);

           
        }


    }
}
